#include <ch9.h>
#include <Max3421e.h>
#include <Max3421e_constants.h>
#include <Max_LCD.h>
#include <Usb.h>

#include <AndroidAccessory.h>
#include <AndroidAccessory.h>

AndroidAccessory acc("Manufacturer",
"Model",
"Description",
"1.0",
"dataSend.namespace",
"0000000012345678");

/* hook up potentiometer edges to 5v and ground. 
 Wiper arm to Analog in pin A0
 
 Should be good from there
 
 */


int sensorPin = A0;    // select the input pin for the potentiometer
int ledPin = 13;      // select the pin for the LED
int sensorValue = 0;  // variable to store the value coming from the sensor

void setup() {
  // declare the ledPin as an OUTPUT:

  Serial.begin(115200);
  acc.powerOn();
}

void loop()
{
  byte msg[1]; // one byte
  sensorValue = analogRead(sensorPin);   
  if (acc.isConnected())
  {
    // is connected
    //      msg[0] = sensorValue;
    msg[0] = 129;
    // Serial.println(sensorValue);
    acc.write(msg, 1);
    delay(50); 

  }
}


